<?php

namespace app\admin\model\music;

use app\logic\model\music\MusicSkewerTypeLogicModel;

class MusicSkewerTypeModel extends MusicSkewerTypeLogicModel
{

    public static function isTwo($type_id)
    {
        if(empty($type_id)){
            return false;
        }
        $info = self::where('id',$type_id)->find();
        if(empty($info)){
            return '分类不存在';
        }
        if($info['pid']!=0){
            return true;
        }
        return '分类不属于二级';
    }

    public function getChildNum($id)
    {
        return $this->where('pid',$id)->count();
    }
}